package cn.com.guage.dtm.verify.service.impl;

import java.util.List;
import cn.com.guage.dtm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.com.guage.dtm.verify.mapper.VerifyFieldRuleManageMapper;
import cn.com.guage.dtm.verify.domain.VerifyFieldRuleManage;
import cn.com.guage.dtm.verify.service.IVerifyFieldRuleManageService;
import cn.com.guage.dtm.common.core.text.Convert;

/**
 * 字段检核规则Service业务层处理
 * 
 * @author yangdechao
 * @date 2021-06-24
 */
@Service
public class VerifyFieldRuleManageServiceImpl implements IVerifyFieldRuleManageService 
{
    @Autowired
    private VerifyFieldRuleManageMapper verifyFieldRuleManageMapper;

    /**
     * 查询字段检核规则
     * 
     * @param checkRuleId 字段检核规则ID
     * @return 字段检核规则
     */
    @Override
    public VerifyFieldRuleManage selectVerifyFieldRuleManageById(Long checkRuleId)
    {
        return verifyFieldRuleManageMapper.selectVerifyFieldRuleManageById(checkRuleId);
    }

    /**
     * 查询字段检核规则列表
     * 
     * @param verifyFieldRuleManage 字段检核规则
     * @return 字段检核规则
     */
    @Override
    public List<VerifyFieldRuleManage> selectVerifyFieldRuleManageList(VerifyFieldRuleManage verifyFieldRuleManage)
    {
        return verifyFieldRuleManageMapper.selectVerifyFieldRuleManageList(verifyFieldRuleManage);
    }

    /**
     * 新增字段检核规则
     * 
     * @param verifyFieldRuleManage 字段检核规则
     * @return 结果
     */
    @Override
    public int insertVerifyFieldRuleManage(VerifyFieldRuleManage verifyFieldRuleManage)
    {
        verifyFieldRuleManage.setCreateTime(DateUtils.getNowDate());
        return verifyFieldRuleManageMapper.insertVerifyFieldRuleManage(verifyFieldRuleManage);
    }

    /**
     * 修改字段检核规则
     * 
     * @param verifyFieldRuleManage 字段检核规则
     * @return 结果
     */
    @Override
    public int updateVerifyFieldRuleManage(VerifyFieldRuleManage verifyFieldRuleManage)
    {
        verifyFieldRuleManage.setUpdateTime(DateUtils.getNowDate());
        return verifyFieldRuleManageMapper.updateVerifyFieldRuleManage(verifyFieldRuleManage);
    }

    /**
     * 删除字段检核规则对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteVerifyFieldRuleManageByIds(String ids)
    {
        return verifyFieldRuleManageMapper.deleteVerifyFieldRuleManageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除字段检核规则信息
     * 
     * @param checkRuleId 字段检核规则ID
     * @return 结果
     */
    @Override
    public int deleteVerifyFieldRuleManageById(Long checkRuleId)
    {
        return verifyFieldRuleManageMapper.deleteVerifyFieldRuleManageById(checkRuleId);
    }
}
